#ifndef __READEDFONT_H__
#define __READEDFONT_H__

#include "include/IFont.h"

#define NUM_LETTERS_IN_FONT	96

typedef struct CharData
{
	vector2dvpos Pos;
	vector2dvpos Len;
} CharData;

class CReadedFont : public IFont
{
private:
	CharData NodeLetter;								//!< Temporal for trespassing information.
protected:
	CharData chdata[256];								//!< Position and length of all the characters (ASCII).
	IVectorContainer<ITexture>	LetterTextures;			//!< Vector with the textures for each letter.
	std::list<ITextSceneNode*> TextsFromThisFont;		//!< List with the texts created with this font. Useful for deleting them or changing the font.
	vector2dvpos OriginalPoints;						//!< Original points from the font, useful to maintain the aspect-ratio of the font.
public:
	CReadedFont(IImage *img);
	virtual ~CReadedFont();

	void CreateTextureForLetter(u8 Letter,CharData *nl,IImage *im);
	void CalculatePositionInScreen(const vector2dvpos &Len,vector2dvpos &Ret1,vector2dvpos &Ret2,
		vector2dvpos &Ret3,vector2dvpos &Ret4,vector2dvpos &Factor);
	virtual void AddTextToThisFont(ITextSceneNode *newText);
	virtual IDrawableFace *GetNewDrawableFaceForThisLetter(s8 Letter,vPos Points);
	virtual void UpdateDrawableFaceForThisLetter(s8 Letter,IDrawableFace *df,vPos Points);
};

#endif
